import React, { useEffect } from 'react';
import { Form, message } from 'antd';
import { FormLabelAttachment, Loading } from '@ecoding/components.antd';

const C = () => {
    const [form] = Form.useForm(); // 该组件内form全局变量

    useEffect(() => {
        form.setFieldValue("field", [{
            name: "文件1",
            url: "https://sci-official-website.sciecomm.cn/2024-04-17/0453b187-121d-4237-98d2-59b5d3dc4c09.600_600.png"
        },{
            name: "文件2",
            url: "https://sci-official-website.sciecomm.cn/2024-04-17/0453b187-121d-4237-98d2-59b5d3dc4c09.600_600.png"
        }]);
    }, []);

    return (
        <Form form={form} preserve={false} layout="vertical">
            <Form.Item name="field">
                <FormLabelAttachment />
            </Form.Item>
        </Form>
        
    );
}

export default C;